﻿<phone:PhoneApplicationPage x:Class="USElections.Pages.SettingsPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            mc:Ignorable="d"
                            d:DesignHeight="768"
                            d:DesignWidth="480"
                            shell:SystemTray.IsVisible="True"
                            shell:SystemTray.Opacity="0">
    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle"
                       Text="US ELECTIONS"
                       Style="{StaticResource PhoneTextNormalStyle}" />
            <TextBlock x:Name="PageTitle"
                       Text="settings"
                       Margin="9,-7,0,0"
                       Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>

        <ScrollViewer Grid.Row="1"
                      Margin="12, 0, 0, 0">
            <StackPanel>
                <StackPanel x:Name="AnonymousHttpReportingStackPanel">
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}"
                               Text="Anonymous error reporting"
                               Margin="12" />
                    <toolkit:ToggleSwitch Margin="0, -36, 0, 0"
                                          IsChecked="{Binding AllowAnonymousHttpReporting, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextNormalStyle}"
                               TextWrapping="Wrap"
                               Margin="12, -24, 0, 0">
                            This feature will automatically send anonymous error reports that will help improve the application.
                    </TextBlock>
                </StackPanel>

                <StackPanel x:Name="LiveTileStackPanel">
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}"
                               Text="Live Tile updates"
                               Margin="12, 24, 12, 12" />
                    <toolkit:ToggleSwitch Margin="0, -36, 0, 0" 
                                          IsChecked="{Binding Enabled, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextNormalStyle}"
                               TextWrapping="Wrap"
                               Margin="12, -24, 0, 0">
                            This feature will inform about newly casted votes through the LiveTile. The application needs to be pinned to the start screen.
                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</phone:PhoneApplicationPage>